package com.tedu.bill.demo2;

/**
 * Author：毕龙
 * Date: 2024/5/24 10:44
 */
public class TestThreadMethod2 {
    public static void main(String[] args) {

        Thread t1 = new Thread(()->{
            for (int i = 0; i < 100; i++) {
                Thread.yield();
                System.out.println(Thread.currentThread().getName()+"\t"+i);
            }
        },"小花");
        Thread t2 = new Thread(()->{
            for (int i = 0; i < 100; i++) {
                Thread.yield();
                System.out.println(Thread.currentThread().getName()+"\t"+i);
            }
        },"小黑");
        t1.start();
        t2.start();
    }
}
